package edu.ccut.saturn.studio.wfg.wfgmodel;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

import edu.ccut.saturn.studio.core.util.xml.SaturnW3CUtil;
import edu.ccut.saturn.studio.wfg.utils.RunTime;

public class ExtendAttributeForFormData implements SaturnAttribute{
	
	private String optionItem = "";
	
	private String optionValue = "";
	
//	private String ifChecked = "-1";
	
	public ExtendAttributeForFormData(){
		
	}
	
	public ExtendAttributeForFormData(ExtendAttributeForFormData attribute){
		this.optionItem = attribute.optionItem;
		this.optionValue = attribute.optionValue;
//		this.ifChecked = attribute.ifChecked;
	}
	
	public String getOptionItem() {
		return optionItem;
	}

	public void setOptionItem(String optionItem) {
		this.optionItem = optionItem;
	}

	public String getOptionValue() {
		return optionValue;
	}

	public void setOptionValue(String optionValue) {
		this.optionValue = optionValue;
	}
	
//	public String getIfChecked() {
//		return ifChecked;
//	}
//
//	public void setIfChecked(String ifChecked) {
//		this.ifChecked = ifChecked;
//	}
	
	public Node creatNode(Document document, String NodeName){
		Node dataNode = document.createElement(SaturnName.KEY_NODE_NAME_PROPERTY);
		SaturnW3CUtil.createAttribute(dataNode, SaturnName.KEY_NONE_NAME_VALUE,RunTime.getValue(this, SaturnName.METHOD_GETOPTIONITEM));
//		ModelXmlUtils.createAttribute(document, dataNode, SaturnName.ASSOCIATE,RunTime.getValue(this, SaturnName.METHOD_GETIFCHECKED));
		dataNode.appendChild(document.createTextNode(RunTime.getValue(this, SaturnName.METHOD_GETOPTIONVALUE)));
		return dataNode;
	}
}
